package com.wofish.goods.service.impl;

import com.wofish.common.core.text.Convert;
import com.wofish.goods.domain.Brand;
import com.wofish.goods.mapper.BrandMapper;
import com.wofish.goods.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 品牌 服务层实现
 * 
 * @author wofish
 * @date 2019-06-06
 */
@Service
public class BrandServiceImpl implements IBrandService {
    @Autowired
    private BrandMapper brandMapper;

    /**
     * 查询品牌信息
     * 
     * @param brandId 品牌ID
     * @return 品牌信息
     */
    @Override
    public Brand selectBrandById(Long brandId) {
        return brandMapper.selectBrandById(brandId);
    }

    @Override
    public List<Brand> selectBrandByTypeId(Long typeId) {
        return brandMapper.selectBrandByTypeId(typeId);
    }

    /**
     * 查询品牌列表
     * 
     * @param brand 品牌信息
     * @return 品牌集合
     */
    @Override
    public List<Brand> selectBrandList(Brand brand) {
        return brandMapper.selectBrandList(brand);
    }
	
    /**
     * 新增品牌
     * 
     * @param brand 品牌信息
     * @return 结果
     */
    @Override
    public int insertBrand(Brand brand) {
        return brandMapper.insertBrand(brand);
    }

    /**
     * 修改品牌
     * 
     * @param brand 品牌信息
     * @return 结果
     */
    @Override
    public int updateBrand(Brand brand) {
        return brandMapper.updateBrand(brand);
    }

    /**
     * 删除品牌对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBrandByIds(String ids) {
        return brandMapper.deleteBrandByIds(Convert.toStrArray(ids));
    }
	
}
